<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>互评历史列表</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>

		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<style>
		html,body {
				
				background-color: #f3f5f7;
			}
			.hand-style {
				border-radius: 60px;
				width: 60px;
				height: 60px;
			}
			.mui-table-view .mui-media-object {
				line-height: 60px;
				max-width: 60px;
				height: 60px;
			}
			.line-height30 {
				line-height: 30px;
			}
			.scores-div-style {
				position: absolute;
				right: 10px;
			
				top: 25%;
				text-align: center;
			}
			.colorblue {
			color: #18b4ed;
		}
		</style>
	</head>
	<body>
		<div id='mian'>
			<ul class="mui-table-view" id="divlist">
				<!--<li class="mui-table-view-cell mui-media">
				 <img class="mui-media-object mui-pull-left hand-style" src="../../image/icon_head_ask_class.png">
					<div class="mui-media-body line-height30 base_black_grey base_content_font">
						幸福
						<p class='mui-ellipsis base_dark_grey_shallow base_tag_font' >
							2017-7-10
						</p>
					</div> 
					
					<div class="  scores-div-style base_dark_grey_shallow base_content_font" >
						评分
						<p class='mui-ellipsis colorblue base_title_font'>
							600
						</p>
					</div> 
				</li>
			<li class="mui-table-view-cell mui-media">
				 <img class="mui-media-object mui-pull-left hand-style" src="../../image/icon_head_ask_class.png">
					<div class="mui-media-body line-height30 base_black_grey base_content_font">
						幸福
						<p class='mui-ellipsis base_dark_grey_shallow base_tag_font' >
							2017-7-10
						</p>
					</div> 
					
					<div class="  scores-div-style base_dark_grey_shallow base_content_font" >
						评分
						<p class='mui-ellipsis colorblue base_title_font'>
							60
						</p>
					</div> 
				</li>-->
				
			</ul>
			</div>
			<div class="noSign" hidden="hidden" id="noData">
				<img src="../../image/icon_img.png" width="60%">
				<p class="font16 top_15 base_dark_grey" >
					暂无数据
				</p>
			</div>
			<div class="loadFailure" hidden="hidden" id="noNet">
				<img src="../../image/icon_img01.png" width="60%">
				<p class="" >
					数据加载失败
				</p>
				<p>
					请检查您的网络
				</p>
				<button type="button"  onclick="loadData()"class="mui-btn mui-btn-outlined">
					重新加载
				</button>
			</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/common.js"></script>
	<script type="text/javascript">
		var page = 1;
		var row = 10;
		var refreshCount = 0;
		var pageParam = '';
		//新请求到的数据条数
		apiready = function() {
			loadNewData();
			setRefreshHeader();
			setPullUpRefresh();
	        if (api.pageParam.usertype == "student") {
				sendBuriedNotifi('0', '学生端互评历史页', '188');
			} else {
				sendBuriedNotifi('0', '老师端互评历史页', '212');
			}
		}
		 function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		
		function loadNewData() {
			page = 1;
			loadData();
		}

		function loadMoreData() {
			page++;
			loadData();
		}

		//获取班级学生列表
		function loadData() {
			showProgress();
			pageParam = api.pageParam;
			var url =  url_getTeacherMutualEvaluationList;//默认老师
			if($api.getStorage('cfnetSelectType') == 0){//学生
			 url = url_StugetMutualEvaluationRecord;
			
			}
			var params = {
				jid : $api.getStorage('cfnetppjxid'),
				uid : $api.getStorage('cfnetppuid'),
				cid : pageParam.cid,
				pid : pageParam.pid,
				page : page,
				rows : row
			};
//				alert(JSON.stringify(params));
			cfnetppPOST(url, params, true, function(data, status) {
//								alert(JSON.stringify(data));
				api.hideProgress();
				api.refreshHeaderLoadDone();
				if (status == 'success') {
					if (data.code == 200) {
						var students = data.data.list;
						refreshCount = students.length;
//							alert(JSON.stringify(students));
						if (students != '' && students.constructor == Array && students.length > 0) {
							$('#noData').hide();
							$('#noNet').hide();
							$('#mian').show();
							writelist(students, students.length);
						} else {
							$('#noData').show();
							$('#noNet').hide();
						}
					} else if (data.code = 109) {
					
						if (page == 1) {
							$('#noData').show();
							$('#noNet').hide();
							$('#mian').hide();
						}
					} else {
						if (page == 1) {
							$('#noData').show();
							$('#noNet').hide();
							$('#mian').hide();
						}
					}
				} else {
					$('#noData').hide();
					$('#noNet').show();
					$('#mian').hide();
					//					api.toast({
					//						msg : '获取学生列表失败'
					//					});
				}
			});
		}

		function writelist(quar_list, len) {
		var strhtml = '';
			for (var i = 0; i < len; i++) {
				data = quar_list[i];
				var score = '';
			
				var str = '<li class="mui-table-view-cell mui-media" onclick="itemclick('+data.uid+','+data.iid+')">'+
				 '<img class="mui-media-object mui-pull-left hand-style" src='+headImgUrl(data.picurl)+'>'+
					'<div class="mui-media-body line-height30 base_black_grey base_content_font">'+
						data.name+
						'<p class="mui-ellipsis base_dark_grey_shallow base_tag_font" >'+
							getCurrentDate(data.endtime)+
						'</p>'+
					'</div> '+
					'<div class="  scores-div-style base_dark_grey_shallow base_content_font" >评分'+
					
						'<p class="mui-ellipsis colorblue base_title_font">'+
							data.scores
						'</p>'+
					'</div> '+
				'</li>';
				strhtml = strhtml + str;
			}
			if (page == 1) {
				$('#divlist').html(strhtml);
			} else {
				$('#divlist').append(strhtml);
			}
		}




		function itemclick(stuid, id) {
		       //学生0
		       
		       if($api.getStorage('cfnetSelectType') == 0){
//		        alert(stuid+"==="+id);

                api.sendEvent({
		          name:'openStudentMutualRatingViewWindNotice',
		           extra : {
		            stuid : stuid,
						id : id,
						status :2//详情
		           }
              });
                api.closeWin({});
				}else{
				  api.openWin({useWKWebView:true,
					name : 'TeacherMutualRatingViewWind',
					url : 'TeacherMutualRatingViewWind.html',
					pageParam : {
						stuid : stuid,
						id : id,
						status :2,//详情
						sourceurl : window.location.pathname,
				        sourcetitle : document.title,
					},
					
				});
				}

		}
	</script>
</html>